package com.stylefeng.guns.core.timer;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


/**
 * Created by lyz on 2018/1/19.
 */
@Component
public class ScheduledJob  implements Job , ApplicationContextAware {


    private static final Logger LOGGER = LoggerFactory.getLogger(ScheduledJob.class);

    private static ApplicationContext applicationContext;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {

    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if(ScheduledJob.applicationContext == null){
            ScheduledJob.applicationContext  = applicationContext;
        }
    }
}